## API Report File for "@backstage/plugin-catalog-backend-module-github"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { AnalyzeOptions } from '@backstage/plugin-catalog-node';
import { CatalogProcessor } from '@backstage/plugin-catalog-node';
import { CatalogProcessorEmit } from '@backstage/plugin-catalog-node';
import { Config } from '@backstage/config';
import { Entity } from '@backstage/catalog-model';
import { EntityProvider } from '@backstage/plugin-catalog-node';
import { EntityProviderConnection } from '@backstage/plugin-catalog-node';
import { EventBroker } from '@backstage/plugin-events-node';
import { EventParams } from '@backstage/plugin-events-node';
import { EventSubscriber } from '@backstage/plugin-events-node';
import { GithubCredentialsProvider } from '@backstage/integration';
import { GithubIntegrationConfig } from '@backstage/integration';
import { graphql } from '@octokit/graphql';
import { LocationSpec } from '@backstage/plugin-catalog-node';
import { Logger } from 'winston';
import { PluginEndpointDiscovery } from '@backstage/backend-common';
import { PluginTaskScheduler } from '@backstage/backend-tasks';
import { ScmIntegrationRegistry } from '@backstage/integration';
import { ScmLocationAnalyzer } from '@backstage/plugin-catalog-node';
import { TaskRunner } from '@backstage/backend-tasks';
import { TokenManager } from '@backstage/backend-common';
import { UserEntity } from '@backstage/catalog-model';

// @public
export const defaultOrganizationTeamTransformer: TeamTransformer;

// @public
export const defaultUserTransformer: (
  item: GithubUser,
  _ctx: TransformerContext,
) => Promise<UserEntity | undefined>;

// @public
export class GithubDiscoveryProcessor implements CatalogProcessor {
  constructor(options: {
    integrations: ScmIntegrationRegistry;
    logger: Logger;
    githubCredentialsProvider?: GithubCredentialsProvider;
  });
  // (undocumented)
  static fromConfig(
    config: Config,
    options: {
      logger: Logger;
      githubCredentialsProvider?: GithubCredentialsProvider;
    },
  ): GithubDiscoveryProcessor;
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  readLocation(
    location: LocationSpec,
    _optional: boolean,
    emit: CatalogProcessorEmit,
  ): Promise<boolean>;
}

// @public @deprecated (undocumented)
export class GitHubEntityProvider implements EntityProvider {
  // (undocumented)
  connect(connection: EntityProviderConnection): Promise<void>;
  // (undocumented)
  static fromConfig(
    config: Config,
    options: {
      logger: Logger;
      schedule?: TaskRunner;
      scheduler?: PluginTaskScheduler;
    },
  ): GitHubEntityProvider[];
  // (undocumented)
  getProviderName(): string;
  // (undocumented)
  refresh(logger: Logger): Promise<void>;
}

// @public
export class GithubEntityProvider implements EntityProvider, EventSubscriber {
  // (undocumented)
  connect(connection: EntityProviderConnection): Promise<void>;
  // (undocumented)
  static fromConfig(
    config: Config,
    options: {
      logger: Logger;
      schedule?: TaskRunner;
      scheduler?: PluginTaskScheduler;
    },
  ): GithubEntityProvider[];
  // (undocumented)
  getProviderName(): string;
  // (undocumented)
  onEvent(params: EventParams): Promise<void>;
  // (undocumented)
  refresh(logger: Logger): Promise<void>;
  // (undocumented)
  supportsEventTopics(): string[];
}

// @public (undocumented)
export class GithubLocationAnalyzer implements ScmLocationAnalyzer {
  constructor(options: GithubLocationAnalyzerOptions);
  // (undocumented)
  analyze(options: AnalyzeOptions): Promise<{
    existing: {
      location: {
        type: string;
        target: string;
      };
      isRegistered: boolean;
      entity: Entity;
    }[];
  }>;
  // (undocumented)
  supports(url: string): boolean;
}

// @public (undocumented)
export type GithubLocationAnalyzerOptions = {
  config: Config;
  discovery: PluginEndpointDiscovery;
  tokenManager: TokenManager;
  githubCredentialsProvider?: GithubCredentialsProvider;
};

// @public
export type GithubMultiOrgConfig = Array<{
  name: string;
  groupNamespace: string;
  userNamespace: string | undefined;
}>;

// @public
export class GithubMultiOrgEntityProvider implements EntityProvider {
  constructor(options: {
    id: string;
    gitHubConfig: GithubIntegrationConfig;
    githubCredentialsProvider: GithubCredentialsProvider;
    githubUrl: string;
    logger: Logger;
    orgs?: string[];
    userTransformer?: UserTransformer;
    teamTransformer?: TeamTransformer;
  });
  // (undocumented)
  connect(connection: EntityProviderConnection): Promise<void>;
  // (undocumented)
  static fromConfig(
    config: Config,
    options: GithubMultiOrgEntityProviderOptions,
  ): GithubMultiOrgEntityProvider;
  // (undocumented)
  getProviderName(): string;
  read(options?: { logger?: Logger }): Promise<void>;
}

// @public
export interface GithubMultiOrgEntityProviderOptions {
  eventBroker?: EventBroker;
  githubCredentialsProvider?: GithubCredentialsProvider;
  githubUrl: string;
  id: string;
  logger: Logger;
  orgs?: string[];
  schedule?: 'manual' | TaskRunner;
  teamTransformer?: TeamTransformer;
  userTransformer?: UserTransformer;
}

// @public
export class GithubMultiOrgReaderProcessor implements CatalogProcessor {
  constructor(options: {
    integrations: ScmIntegrationRegistry;
    logger: Logger;
    orgs: GithubMultiOrgConfig;
    githubCredentialsProvider?: GithubCredentialsProvider;
    userTransformer?: UserTransformer;
    teamTransformer?: TeamTransformer;
  });
  // (undocumented)
  static fromConfig(
    config: Config,
    options: {
      logger: Logger;
      githubCredentialsProvider?: GithubCredentialsProvider;
      userTransformer?: UserTransformer;
      teamTransformer?: TeamTransformer;
    },
  ): GithubMultiOrgReaderProcessor;
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  readLocation(
    location: LocationSpec,
    _optional: boolean,
    emit: CatalogProcessorEmit,
  ): Promise<boolean>;
}

// @public @deprecated (undocumented)
export class GitHubOrgEntityProvider extends GithubOrgEntityProvider {
  // (undocumented)
  static fromConfig(
    config: Config,
    options: GitHubOrgEntityProviderOptions,
  ): GitHubOrgEntityProvider;
}

// @public
export class GithubOrgEntityProvider
  implements EntityProvider, EventSubscriber
{
  constructor(options: {
    id: string;
    orgUrl: string;
    gitHubConfig: GithubIntegrationConfig;
    logger: Logger;
    githubCredentialsProvider?: GithubCredentialsProvider;
    userTransformer?: UserTransformer;
    teamTransformer?: TeamTransformer;
  });
  // (undocumented)
  connect(connection: EntityProviderConnection): Promise<void>;
  // (undocumented)
  static fromConfig(
    config: Config,
    options: GithubOrgEntityProviderOptions,
  ): GithubOrgEntityProvider;
  // (undocumented)
  getProviderName(): string;
  // (undocumented)
  onEvent(params: EventParams): Promise<void>;
  read(options?: { logger?: Logger }): Promise<void>;
  // (undocumented)
  supportsEventTopics(): string[];
}

// @public @deprecated (undocumented)
export type GitHubOrgEntityProviderOptions = GithubOrgEntityProviderOptions;

// @public
export interface GithubOrgEntityProviderOptions {
  githubCredentialsProvider?: GithubCredentialsProvider;
  id: string;
  logger: Logger;
  orgUrl: string;
  schedule?: 'manual' | TaskRunner;
  teamTransformer?: TeamTransformer;
  userTransformer?: UserTransformer;
}

// @public
export class GithubOrgReaderProcessor implements CatalogProcessor {
  constructor(options: {
    integrations: ScmIntegrationRegistry;
    logger: Logger;
    githubCredentialsProvider?: GithubCredentialsProvider;
  });
  // (undocumented)
  static fromConfig(
    config: Config,
    options: {
      logger: Logger;
      githubCredentialsProvider?: GithubCredentialsProvider;
    },
  ): GithubOrgReaderProcessor;
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  readLocation(
    location: LocationSpec,
    _optional: boolean,
    emit: CatalogProcessorEmit,
  ): Promise<boolean>;
}

// @public
export type GithubTeam = {
  slug: string;
  combinedSlug: string;
  name?: string;
  description?: string;
  avatarUrl?: string;
  editTeamUrl?: string;
  parentTeam?: GithubTeam;
  members: GithubUser[];
};

// @public
export type GithubUser = {
  login: string;
  bio?: string;
  avatarUrl?: string;
  email?: string;
  name?: string;
  organizationVerifiedDomainEmails?: string[];
};

// @public
export type TeamTransformer = (
  item: GithubTeam,
  ctx: TransformerContext,
) => Promise<Entity | undefined>;

// @public
export interface TransformerContext {
  // (undocumented)
  client: typeof graphql;
  // (undocumented)
  org: string;
  // (undocumented)
  query: string;
}

// @public
export type UserTransformer = (
  item: GithubUser,
  ctx: TransformerContext,
) => Promise<Entity | undefined>;
```
